home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swaga_c.zip / COLOR.SWG / 0001_Change Background Colors.pas next >
Pascal/Delphi Source File  |  1993-05-28  |  561b  |  24 lines

  1. {
  2. >Hello, I am writing an application that is some what color
  3. >coordinated. I would like to have the background changed (usually
  4. >black) to one of the background colors without affecting the
  5. >foreground (so I do not have to reWrite the foreground screen).  So
  6. }
  7.  
  8. Uses
  9.   Dos;
  10.  
  11. Procedure ChangeBG(Color : Byte);
  12. Var i : Word;
  13. begin
  14.   For i := 0 to 3999 do
  15.     If Odd(i) then
  16.       Mem[$b800:i] := (Mem[$b800:i] and 15) or ((Color and 7) shl 4)
  17. end;
  18.  
  19. Var
  20.   ColChar : String;
  21. begin
  22.   ColChar := ParamStr(1);
  23.   ChangeBg(Ord(ColChar[1]));
  24. end.